﻿namespace IpPortDemo.Tools
{
    /// <summary>
    /// 全局上下文
    /// </summary>
    public class GlobalContext
    {
        /// <summary>
        /// All registered service and class instance container. Which are used for dependency injection.
        /// </summary>
        public static IServiceCollection Services { get; set; }

        /// <summary>
        /// Configured service provider.
        /// </summary>
        public static IServiceProvider ServiceProvider { get; set; }

        public static IConfiguration Configuration { get; set; }

        public static IWebHostEnvironment HostingEnvironment { get; set; }

        /// <summary>
        /// 允许访问的IP地址和端口
        /// </summary>
        public static AllowedIpPort  AllowedIpPort { get; set; }
    }

    /// <summary>
    /// 允许访问的IP地址和端口
    /// </summary>
    public class AllowedIpPort
    {
        /// <summary>
        /// 文件地址前缀
        /// </summary>
        public string Url { get; set; }
    }
}
